import React, { Component } from 'react';
import { Tooltip, message, Switch } from 'antd';
import './index.css';


class Toolbar extends Component {
  
  state = {
    modeler: null,
    scale: 1,
    svgVisible: 'none',
    svgSrc: '',
    issimulation: false,
  };

  componentDidMount() {
    
  }

  /**
   * 前进操作
   */
  handleRedo = () => {
    this.state.modeler.get('commandStack').redo();
  };

  /**
   * 撤销操作
   */
  handleUndo = () => {
    this.state.modeler.get('commandStack').undo();
  };


  /**
   * 保存xml
   */
  handleSaveXml = async () => {


  };

  /**
   * 下载Bpmn文件
   */
  handleDownloadSvg = () => {
   
  };

  /**
   * 下载 XML 格式
   */
  handleDownloadXml = () => {
    
  };


  render() {
    const { svgVisible, svgSrc, issimulation } = this.state;
    return (
      <div>
        <ul className="workflow-ui-editorToolbar">
          
          <Tooltip title="打开BPMN文件" placement="bottom" color="#108ee9">
            <li>
              <label>
                <div
                  className="workflow-ui-openIt"
                  onClick={this.handleSaveXml}
                ></div>
                <input type="file" style={{ display: 'none' }} />
              </label>
            </li>
          </Tooltip>
          <Tooltip title="撤销" placement="bottom" color="#108ee9">
            <li className="workflow-ui-undo" onClick={this.handleSaveXml}></li>
          </Tooltip>
          <Tooltip title="恢复" placement="bottom" color="#108ee9">
            <li className="workflow-ui-redo" onClick={this.handleSaveXml}></li>
          </Tooltip>
          <Tooltip title="放大" placement="bottom" color="#108ee9">
            <li
              className="workflow-ui-zoomIn"
              onClick={this.handleSaveXml(0.1)}
            ></li>
          </Tooltip>
          <Tooltip title="保存流程" placement="bottom" color="#108ee9">
            <li className="workflow-ui-save" onClick={this.handleSaveXml}></li>
          </Tooltip>
          <Tooltip title="下载Bpmn文件" placement="bottom" color="#108ee9">
            <li
              className="workflow-ui-download"
              onClick={this.handleSaveXml}
            ></li>
          </Tooltip>
        </ul>
      </div>
    );
  }
}

export default Toolbar;
